package com.siteseat.crudeq.kernel;

import com.siteseat.crudeq.kernel.exception.DeployException;

/**
 *
 */
public interface QueueManager extends KernelObject {

  /**
   * @param qid
   * @throws DeployException
   */
  Queue ensureDeployed( Integer qid ) throws DeployException;
  Queue ensureDeployed( String name ) throws DeployException;

  /**
   * @param qid
   * @throws DeployException
   */
  void ensureNotDeployed( Integer qid ) throws DeployException;
  void ensureNotDeployed( String name ) throws DeployException;

  /**
   * @param profile
   * @throws DeployException
   */
  void deploy( String actor, QueueProfile profile ) throws DeployException;

  /**
   * @param qid
   * @return
   */
  boolean isDeployed( Integer qid );
  boolean isDeployed( String name );

  /**
   * @param qid
   * @throws DeployException
   */
  void undeploy( String actor, Integer qid ) throws DeployException;
  void undeploy( String actor, String name ) throws DeployException;

  /**
   * @param qid
   * @return
   */
  Queue find( Integer qid );
  
  Queue find( String queueName );
  
  QueueListenerManager getListenerManager();

}
